//
//  OneViewController.m
//  AnimationDemo
//
//  Created by 马滕亚 on 2020/6/12.
//  Copyright © 2020 M.Y.A. All rights reserved.
//

#import "OneViewController.h"
#import "TwoViewController.h"
#import "CircleTransition.h"
#import "ViewController.h"

@interface OneViewController ()<UINavigationControllerDelegate,MyDelegate>

@end

@implementation OneViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.delegate = self;
}

- (void)doSomething {
    NSLog(@"1111");
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    self.navigationController.delegate = self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    
    NSArray *array = @[@"12-11", @"12-11", @"12-11", @"12-12", @"12-13", @"12-14"];
    
    NSMutableArray *newArray = [array mutableCopy];
    
//    for (NSString *str in array) {
//        if (![newArray containsObject:str]) {
//            [newArray addObject:str];
//        }
//    }
    
//    for (int i = 0; i<newArray.count; i++) {
//        if (newArray[i] == newArray[i+1]) {
//            [newArray removeObject:newArray[i]];
//        }
//    }
    
//    NSSet
    
//    NSSet *set = [NSSet setWithArray:array];
    
    //
    
//    NSLog(@"--%@",newArray);
//    NSLog(@"--%@",array);
//    NSLog(@"--%@",set);
    
}
- (IBAction)oneBtnClick:(id)sender {
    TwoViewController *vc = [[TwoViewController alloc] init];
    [self.navigationController pushViewController:vc animated:true];
}

- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {
    if (operation == UINavigationControllerOperationPush) {
        CircleTransition *transition = [[CircleTransition alloc] init];
        return transition;
    } else {
        return nil;
    }
}





/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
